package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("userDao")
public interface UserDao {

    @Insert("insert into user(name,money)values(#{name},#{money})")
    void save(User user);

    @Delete("delete from user where id = #{id} ")
    void delete(Integer id);

    @Update("update user set name = #{name} , money = #{money} where id = #{id} ")
    void update(User user);

    @Select("select * from user")

    List<User> findAll();

    @Select("select * from user where id = #{id} ")

    User findById(Integer id);
}